package ltd.newbee.mall.mapstruct;

import ltd.newbee.mall.dto.AdminLoginDto;
import ltd.newbee.mall.entity.AdminLogin;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
import org.mapstruct.Mappings;

/**
 * @description:
 * @author: qzx
 * @date: 2022-08-12 12:04
 * @version: 1.0
 */
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)
public interface AdminLoginConvertMapper extends BaseConvertMapper<AdminLoginDto, AdminLogin> {

    @Mappings({
            @Mapping(target = "id", source = "id"),
            @Mapping(target = "userId", source = "userId"),
            @Mapping(target = "nickName", source = "nickName"),
            @Mapping(target = "address", source = "address"),
            @Mapping(target = "ua", source = "ua"),
            @Mapping(target = "os", source = "os"),
            @Mapping(target = "browser", source = "browser"),
            @Mapping(target = "loginTime", source = "loginTime")
    })
    AdminLogin toEntity(AdminLoginDto dto);

}
